package _general;

import java.awt.Component;
import java.awt.Dimension;
import java.util.Collection;

import javax.swing.BoxLayout;
import javax.swing.JFrame;

public class Window<E> extends JFrame{

	static final long serialVersionUID = 1;

	DrawPanel<E> drawPanel;
	
	
	public Window (Collection<E> pointSet, String name){
		super (name);
		
		int w = Config.WindowWidth;
		int h = Config.WindowHeight;
		
		setLocation (1, 1);
		setSize (w, h);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// Linke Seite mit Text und eigentlichem Lösungsbereich
		drawPanel = new DrawPanel<E>(pointSet);
		drawPanel.setLayout(new BoxLayout (drawPanel, BoxLayout.PAGE_AXIS));
		drawPanel.setPreferredSize(new Dimension (w, h));
		drawPanel.setMaximumSize(new Dimension (w, h));
		drawPanel.setMinimumSize(new Dimension (w, h));
		
		drawPanel.setAlignmentY(Component.LEFT_ALIGNMENT);
		
		getContentPane().add(drawPanel);
		
		setVisible (true);
	}
}
